//         https://ac.nowcoder.com/acm/problem/213140



#include <iostream>
#include <queue>
using namespace std;

priority_queue<int> q;

int main()
{
    int n, k;
    cin >> n >> k;
    long long ans = 0;

    for (int i = 1; i <= n; i++)
    {
        int a;
        cin >> a;
        if (a % 2 == 0)
            q.push(a);
        else
            ans += a;
    }

    while (k > 0 && q.size())
    {
        int x = q.top();
        q.pop();
        x /= 2;
        k--;
        if (x % 2 == 0)
            q.push(x);
        else
            ans += x;
    }

    while (q.size())
        ans += q.top(), q.pop();

    cout << ans << endl;

    return 0;
}